package com.orange;


import com.mysql.jdbc.Driver;
import com.orange.factoryPatterns.pojo.Squere;
import com.orange.singlePatterns.HungrySingleton;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.DriverManager;
import java.util.concurrent.CopyOnWriteArrayList;

public class Application {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("application.xml");
        Object test = classPathXmlApplicationContext.getBean("test");
        HungrySingleton hungryBean=(HungrySingleton) test;
    }

    class myFactoryBean implements FactoryBean{

        public Object getObject() throws Exception {
            return new Squere();
        }

        public Class<?> getObjectType() {
            return null;
        }

        public boolean isSingleton() {
            return false;
        }
    }

}
